
import Vue from 'vue';
import base from './base';

/**
 * 通用接口功能
 */
export default class comm extends base {
	
	
/* 新项目方法 */
		
	/**
	 * 获取当前登录用户  
	 */
	static async GetMe() {
		const url = `${this.baseUrl}/getme`;
		return await this.get(url,{version:Vue.prototype.version});
	}
	
	/**
	 * 查看用户
	 */
	static async CheckUser(id) {
		const url = `${this.baseUrl}/user/${id}/other`;
		return await this.get(url,{version:Vue.prototype.version});
	}
	
	/**
	* 同步用户数据
	*/
	static async AsyncUserData(user) {
		return this.post(`${this.baseUrl}/asyncuserdata`, {ed: user.encryptedData, iv: user.iv})
	}
	
	/**
	* 获取微信绑定手机号
	*/
	static async GetUserPhone(encryptedData,iv) {
		return this.get(`${this.baseUrl}/getphone`, {encryptedData: encryptedData, iv: iv})
	}
	
	/**
	* 设置小程序绑定手机号
	*/
	static async SetUserPhone(phone) {
		return this.post(`${this.baseUrl}/user/setphone`, {phone:phone})
	}
	
	/*
	*获取首页轮播图
	*/
	static async GetSwiper(limit) {
		const url = `${this.baseUrl}/carousels`;
		return await this.get(url,{limit:limit,version:Vue.prototype.version});
	}
	
	/*
	*获取公告信息列表 
	*/
	static async GetNotices(limit) {
		const url = `${this.baseUrl}/notices`;
		return await this.get(url,{limit:limit,version:Vue.prototype.version});
	}
	
	/*
	*获取公告信息列表 
	*/
	static async GetAppnavs(limit) {
		const url = `${this.baseUrl}/appnavs`
		return await this.get(url,{limit:limit,version:Vue.prototype.version})
	}
	
	
  /**
   *获取打卡广场记录
   */
  static async GetHotPost(page,limit) {
  	const url = `${this.baseUrl}/hotpost`;
  	return await this.get(url,{page:page,limit:limit,version:Vue.prototype.version});
  }
	
	/**
	 *获取搜索打卡记录
	 */
	static async GetSearchPost(content,orderby,limit,circleid) {
		const url = `${this.baseUrl}/posts`;
		return await this.get(url,{q:content,orderby:orderby,circleid,limit:limit,version:Vue.prototype.version});
	}
	
	/**
	 *获取圈子分类
	 */
	static async GetCategories() {
		const url = `${this.baseUrl}/categories`;
		// console.log(url);
		return await this.get(url,{version:Vue.prototype.version});
	}
	
	/**
	 *创建圈子
	 */
	static async CreateCir(category_id,name,intro,logo,cover,priv) {
		const url = `${this.baseUrl}/circles/create`;
		console.log(url);
		return await this.post(url,{category_id:category_id, name:name, intro:intro,logo:logo, cover:cover, priv:priv, version:Vue.prototype.version});
	}
	
	/**
	 *设置允许用户邀请入圈权限
	 */
	static async setInvite2Cir(invite) {
		const url = `${this.baseUrl}/user/setinvite`;
		return await this.post(url,{invite:invite,version:Vue.prototype.version});
	}
	
	/**
	 *邀请用户加入圈子
	 */
	static async invite2Cir(cid,uid) {
		const url = `${this.baseUrl}/circles/${cid}/invite`;
		return await this.post(url,{uid:uid,version:Vue.prototype.version});
	}
	
	/**
	 *获取圈子分类对应的列表
	 */
	static async GetCateCirList(page,limit,cateid) {
		const url = `${this.baseUrl}/circles/cateCircle/${cateid}`;
		return await this.get(url,{page:page,limit:limit,version:Vue.prototype.version});
	}
	
	
	
	/**
	 *获取圈子列表
	 */
	static async GetCircles() {
		const url = `${this.baseUrl}/circles`;
		return await this.get(url);
	}
	
	/**
	 *获取最火圈子列表
	 */
	static async GetHotCircles(page,limit) {
		const url = `${this.baseUrl}/circles/hotcircle`;
		return await this.get(url,{page:page,limit:limit});
	}
	
	/**
	 *获取最新圈子列表
	 */
	static async GetNewCircles(page,limit) {
		const url = `${this.baseUrl}/circles/newcircle`;
		return await this.get(url,{page:page,limit:limit});
	}
	
	/**
	 *获取最近热门圈子列表
	 */
	static async GetRankCircles(page,limit) {
		const url = `${this.baseUrl}/circles/rankcircle`;
		return await this.get(url,{page:page,limit:limit});
	}
	
	/**
	 *获取圈子详情页数据
	 */
	static async GetCirDetail(id) {
		const url = `${this.baseUrl}/circles/show/${id}`;
		return await this.get(url,{version:Vue.prototype.version});
	}
	
	/**
	 *获取圈子排行榜数据
	 */
	static async GetCirRankList(cid,rankType) {
		const url = `${this.baseUrl}/usercircle/index/${cid}`;
		return await this.get(url,{orderby:rankType,version:Vue.prototype.version});
	}
	
	/**
	 *搜索圈子
	 */
	static async GetSearchCir(text,orderby,limit,categoryid) {
		const url = `${this.baseUrl}/circles`;
		return await this.get(url,{q:text,orderby:orderby,limit:limit,categoryid:categoryid,version:Vue.prototype.version});
	}
	
	/**
	 *获取发布打卡时选择类别的圈子
	 */
	static async GetChildCirList(cateid) {
		const url = `${this.baseUrl}/user/postcircles`;
		console.log(url);
		return await this.get(url,{cate_id:cateid,version:Vue.prototype.version});
	}
	
	/**
	 *创建诗歌
	 */
	static async CreatePoem(name,p_name,intro,cover,body) {
		console.log(body);
		const url = `${this.baseUrl}/poems/create`;
		return await this.post(url,{name:name,p_name:p_name,intro:intro,cover:cover,body:body,version:Vue.prototype.version})
	}
	
	/**
	 *获取诗歌列表
	 */
	static async GetPoems() {
		const url = `${this.baseUrl}/poems`;
		return await this.get(url,{version:Vue.prototype.version})
	}
	
	/**
	 *获取诗歌详情
	 */
	static async GetPoemDetail(id) {
		const url = `${this.baseUrl}/poems/show/${id}`;
		return await this.get(url,{version:Vue.prototype.version})
	}
	
	/**
	 *删除诗歌
	 */
	static async DeletePoems(id) {
		const url = `${this.baseUrl}/poems/delete/${id}`;
		return await this.delete(url,{version:Vue.prototype.version})
	}
	
	/**
	 *修改诗歌
	 */
	static async EditPoems(id,name,p_name,intro,cover,body) {
		const url = `${this.baseUrl}/poems/update/${id}`;
		return await this.post(url,{name:name,p_name:p_name,intro:intro,cover:cover,body:body,version:Vue.prototype.version})
	}
	
	/**
	 *创建小说
	 */
	static async CreateNovel(name,p_name,intro,cover) {
		const url = `${this.baseUrl}/novels/create`;
		return await this.post(url,{name:name,p_name:p_name,intro:intro,cover:cover,version:Vue.prototype.version})
	}
	
	/**
	 *获取小说列表
	 */
	static async GetNovels() {
		const url = `${this.baseUrl}/novels`;
		return await this.get(url,{version:Vue.prototype.version})
	}
	
	/**
	 *获取小说详情
	 */
	static async GetNovelDetail(id) {
		const url = `${this.baseUrl}/novels/show/${id}`;
		return await this.get(url,{version:Vue.prototype.version})
	}
	
	/**
	 *修改小说
	 */
	static async EditNovel(id,name,p_name,intro,cover) {
		const url = `${this.baseUrl}/novels/update/${id}`;
		return await this.post(url,{name:name,p_name:p_name,intro:intro,cover:cover,version:Vue.prototype.version})
	}
	
	/**
	 *删除小说
	 */
	static async DeleteNovel(id) {
		const url = `${this.baseUrl}/novels/delete/${id}`;
		return await this.delete(url,{version:Vue.prototype.version})
	}
	
	/**
	 *创建小说章节
	 */
	static async CreateChapter(id,order,title,body) {
		const url = `${this.baseUrl}/chapters/create/${id}`;
		return await this.post(url,{title:title,body:body,order:order,version:Vue.prototype.version})
	}
	
	/**
	 *获取小说章节列表
	 */
	static async GetChapters(id) {
		const url = `${this.baseUrl}/chapters/${id}`;
		return await this.get(url,{version:Vue.prototype.version})
	}
	
	/**
	 *获取当前小说上一章节详情
	 */
	static async GetForwardChapterDetail(novel_id,order) {
		const url = `${this.baseUrl}/chapter_last`;
		return await this.get(url,{novel_id:novel_id,order:order,version:Vue.prototype.version})
	}
	
	/**
	 *获取当前小说章节详情
	 */
	static async GetChapterDetail(id) {
		const url = `${this.baseUrl}/chapters/show/${id}`;
		return await this.get(url,{version:Vue.prototype.version})
	}
	
	/**
	 *获取小说下一章节详情
	 */
	static async GetNextChapterDetail(novel_id,order) {
		const url = `${this.baseUrl}/chapter_next`;
		return await this.get(url,{novel_id:novel_id,order:order,version:Vue.prototype.version})
	}
	
	/**
	 *修改小说章节
	 */
	static async EditChapter(id,title,body,order) {
		const url = `${this.baseUrl}/chapters/update/${id}`;
		return await this.post(url,{title:title,body:body,order:order,version:Vue.prototype.version})
	}
	
	/**
	 *删除小说章节
	 */
	static async DeleteChapter(id) {
		const url = `${this.baseUrl}/chapters/delete/${id}`;
		return await this.delete(url,{version:Vue.prototype.version})
	}
	
	/**
	 *创建文章
	 */
	static async CreateArticle(cover,title,intro,body) {
		const url = `${this.baseUrl}/articles/create`;
		return await this.post(url,{cover:cover,title:title,intro:intro,body:body,version:Vue.prototype.version})
	}
	
	/**
	 *获取文章列表
	 */
	static async GetArticles(limit) {
		const url = `${this.baseUrl}/articles`;
		return await this.get(url,{limit:limit,version:Vue.prototype.version})
	}
	
	/**
	 *获取文章详情
	 */
	static async GetArticleDetail(id) {
		const url = `${this.baseUrl}/articles/show/${id}`;
		return await this.get(url,{version:Vue.prototype.version})
	}
	
	/**
	 *修改文章
	 */
	static async EditArticle(id,cover,title,intro,body) {
		const url = `${this.baseUrl}/articles/update/${id}`;
		return await this.post(url,{cover:cover,title:title,intro:intro,body:body,version:Vue.prototype.version})
	}
	
	/**
	 *删除文章
	 */
	static async DeleteArticle(id) {
		const url = `${this.baseUrl}/articles/delete/${id}`;
		return await this.delete(url,{version:Vue.prototype.version})
	}
	
	/**
	 *获取我的圈子
	 */
	static async GetMyCircles(id) {
		const url = `${this.baseUrl}/circles/mine`;
		console.log(url);
		return await this.get(url,{version:Vue.prototype.version});
	}
	
	/**
	 *邀请用户加入圈子
	 */
	static async CirInvite(cid,uid) {
		const url = `${this.baseUrl}/circles/{cid}/invite`;
		console.log(url);
		return await this.get(url,{uid:uid,version:Vue.prototype.version});
	}
	
	/**
	 *获取推荐圈子
	 */
	static async GetRecommendCircles() {
		const url = `${this.baseUrl}/circles/recommend`;
		// console.log(url);
		return await this.get(url,{version:Vue.prototype.version});
	}
	
	/**
	 *获取圈子详情页打卡记录
	 */
	static async GetCirDetailPost(id) {
		const url = `${this.baseUrl}/circles/post/${id}`;
		console.log(url);
		return await this.get(url,{version:Vue.prototype.version});
	}
	
	/*
	*发布活动  
	*/
	static async CreateActivity(type,title,intro,start_at,end_at,activable_id,images,contact_person,contact_number,max_people,location) {
		console.log('max',max_people);
		const url = `${this.baseUrl}/activities/create`;
		return await this.post(url,{type:type,title:title,intro:intro,start_at:start_at,end_at:end_at,activable_id:activable_id,refresh_at:start_at,images:images,contact_person:contact_person,contact_number:contact_number,max_people:max_people,location:location,version:Vue.prototype.version});
	}
	
	/*
	*获取tabbar栏活动列表  
	*/
	static async GetActivities(page,limit) {
		const url = `${this.baseUrl}/activities`;
		return await this.get(url,{page:page,limit:limit,version:Vue.prototype.version});
	}
	
	/*
	*获取当前用户发布的活动 
	*/
	static async GetMyactivities() {
		const url = `${this.baseUrl}/activities/myactivity`;
		return await this.get(url,{version:Vue.prototype.version});
	}
	
	/*
	*获取用户自建全部的活动列表  
	*/
	static async GetUserAllAct() {
		const url = `${this.baseUrl}/activities/myactivity`;
		return await this.get(url,{version:Vue.prototype.version});
	}
	
	/*
	*获取用户自建未开始的活动列表  
	*/
	static async GetUserUnworkedAct() {
		const url = `${this.baseUrl}/activities/await`;
		return await this.get(url,{version:Vue.prototype.version});
	}
	
	/*
	*获取用户自建进行中的活动列表  
	*/
	static async GetUserWorkingAct() {
		const url = `${this.baseUrl}/activities/start`;
		return await this.get(url,{version:Vue.prototype.version});
	}
	
	/*
	*获取用户自建已结束的活动列表  
	*/
	static async GetUserWorkOutAct() {
		const url = `${this.baseUrl}/activities/end`;
		return await this.get(url,{version:Vue.prototype.version});
	}
	
	/*
	*获取活动报名列表
	*/
	static async GetActRegisList(id) {
		const url = `${this.baseUrl}/useractivity/index/${id}`;
		return await this.get(url,{version:Vue.prototype.version});
	}
	
	/*
	*获取活动报名表链接
	*/
	static async GetActExcelURL(id) {
		const url = `${this.baseUrl}/useractivity/getexcelurl/${id}`;
		return await this.get(url,{version:Vue.prototype.version});
	}
	
	/**
	 *获取活动详情页数据
	 */
	static async GetActDetail(id) {
		const url = `${this.baseUrl}/activities/show/${id}`;
		console.log(url);
		return await this.get(url,{version:Vue.prototype.version});
	}
	
	/**
	 *删除活动
	 */
	static async DelActivity(id) {
		const url = `${this.baseUrl}/activities/delete/${id}`;
		console.log(url);
		return await this.delete(url,{version:Vue.prototype.version});
	}
	
	/*
	*修改活动  
	*/
	static async EditActivity(actid,type,title,intro,start_at,end_at,activable_id,images,contact_person,contact_number,max_people,location) {
		console.log('location',location);
		const url = `${this.baseUrl}/activities/update/${actid}`;
		return await this.post(url,{type:type,title:title,intro:intro,start_at:start_at,end_at:end_at,activable_id:activable_id,refresh_at:start_at,images:images,contact_person:contact_person,contact_number:contact_number,max_people:max_people,location:location,version:Vue.prototype.version});
	}
	
	/**
	 *参加活动
	 */
	static async AttendActivity(actid) {
		const url = `${this.baseUrl}/activities/join/${actid}`;
		console.log(url);
		return await this.get(url,{version:Vue.prototype.version});
	}
	
	/**
	 *检查用户是否已报名
	 */
	static async IsAttendActivity(actid) {
		const url = `${this.baseUrl}/activities/check/${actid}`;
		return await this.get(url,{version:Vue.prototype.version});
	}
	
	/**
	 *取消报名
	 */
	static async CancelRegisActivity(actid) {
		const url = `${this.baseUrl}/activities/cancel/${actid}`;
		return await this.get(url,{version:Vue.prototype.version});
	}
	
	/**
	 *活动报名
	 */
	static async RegisActivity(actid,appl_name,phone,people_num) {
		const url = `${this.baseUrl}/activities/signup/${actid}`;
		console.log(url);
		return await this.post(url,{name:appl_name,phone:phone,people_num:people_num,version:Vue.prototype.version});
	}
	
	/**
	 *发布打卡
	 */
	static async CreatePost(circle_id,body,images,cover,video_data,audio_data,theme_id,Share_type,Share_id) {
		const url = `${this.baseUrl}/posts`;
		console.log(url);
		return await this.post(url,{circle_id:circle_id, body:body, images:images,cover:cover,video_data:video_data,audio_data:audio_data,theme_id:theme_id,Share_type:Share_type, Share_id:Share_id,version:Vue.prototype.version});
	}
	
	/* 
	*获取我的打卡记录	  
	*/
	static async GetPostsRecord(page,limit) {
		const url = `${this.baseUrl}/user/posts`;
		return await this.get(url,{page:page,limit:limit,version:Vue.prototype.version});
	}
	
	/*
	*获取打卡详情	  
	*/
	static async GetPostsDetail(pid) {
		const url = `${this.baseUrl}/posts/${pid}`;
		return await this.get(url,{version:Vue.prototype.version});
	}
	
	/*
	*获取打卡评论详情	  
	*/
	static async GetPostsCommentDetail(cid) {
		const url = `${this.baseUrl}/comments/${cid}/show`;
		return await this.get(url,{version:Vue.prototype.version});
	}
	
	/*
	*获取子级评论列表	  
	*/
	static async GetCommentDetailList(cid,rankType) {
		const url = `${this.baseUrl}/comments/${cid}/comlist`;
		return await this.get(url,{orderby:rankType,version:Vue.prototype.version});
	}
	
	/*
	*获取打卡评论	  
	*/
	static async GetPostComment(page,limit,pid,rankType) {
		// console.log(rankType);
		const url = `${this.baseUrl}/posts/${pid}/comments`;
		return await this.get(url,{page:page,limit:limit,orderby:rankType,version:Vue.prototype.version});
	}
	
	/*
	*添加用户评论	  
	*/
	static async AddUserComment(pid,replay_id,body) {
		console.log('用户评论============',pid,replay_id,body);
		const url = `${this.baseUrl}/posts/${pid}/comments`;
		return await this.post(url,{id:pid, reply_id:replay_id, body:body, version:Vue.prototype.version});
	}
	
	/**
	 * 点赞评论
	 */
	static async LikeComment(commentid) {
		const url = `${this.baseUrl}/comments/${commentid}/like`;
		return await this.get(url);
	}
	
	/**
	 * 取消点赞评论
	 */
	static async UnLikeComment(commentid) {
		const url = `${this.baseUrl}/comments/${commentid}/unlike`;
		return await this.get(url);
	}
	
	/*
	*删除单条打卡记录	  
	*/
	static async DeletePostRecord(pid) {
		const url = `${this.baseUrl}/posts/${pid}/delete`;
		return await this.delete(url,{version:Vue.prototype.version});
	}
	
	/*
	*获取被查看用户打卡记录	  
	*/
	static async GetCheckUserRecord(uid) {
		const url = `${this.baseUrl}/posts/${uid}/otherpost`;
		return await this.get(url,{version:Vue.prototype.version});
	}
	
	/**
	 *关注用户
	 */
	static async Follow(uid) {
		const url = `${this.baseUrl}/user/follow/${uid}`;
		return await this.get(url,{version:Vue.prototype.version});
	}
	
	/**
	 *取消关注用户
	 */
	static async UnFollow(uid) {
		const url = `${this.baseUrl}/user/unfollow/${uid}`;
		return await this.get(url,{version:Vue.prototype.version});
	}
	
	/**
	 *获取关注状态
	 */
	static async IsFollow(uid) {
		const url = `${this.baseUrl}/user/check/${uid}`;
		return await this.get(url,{version:Vue.prototype.version});
	}
	
	/**
	 *获取关注的用户
	 */
	static async GetUserFollower(id) {
		const url = `${this.baseUrl}/user/${id}/otherfollow`;
		return await this.get(url,{version:Vue.prototype.version});
	}
	
	/**
	 *获取关注的用户数量
	 */
	static async GetFollowingsNum() {
		const url = `${this.baseUrl}/user/followingsNum`;
		return await this.get(url,{version:Vue.prototype.version});
	}
	
	/**
	 *获取关注我的用户数量
	 */
	static async GetFollowersNum() {
		const url = `${this.baseUrl}/user/followersNum`;
		return await this.get(url,{version:Vue.prototype.version});
	}
	
	/**
	 *获取被查看用户的粉丝数量
	 */
	static async GetOtherErsNum(id) {
		const url = `${this.baseUrl}/user/${id}/othErsNum`;
		return await this.get(url,{version:Vue.prototype.version});
	}
	
	/**
	 *获取被查看用户的粉丝
	 */
	static async GetFollowOtherNum(id) {
		const url = `${this.baseUrl}/user/${id}/othIngsNum`;
		return await this.get(url,{version:Vue.prototype.version});
	}
	
	/**
	 *查看用户的粉丝
	 */
	static async GetFollowMe(id) {
		const url = `${this.baseUrl}/user/${id}/followOther`;
		return await this.get(url,{version:Vue.prototype.version});
	}
	
	/**
	 *获取关注我的用户
	 */
/* 	static async GetFollowMe() {
		const url = `${this.baseUrl}/user/followme`;
		return await this.get(url,{version:Vue.prototype.version});
	} */
	
	/**
	 *获取通知列表
	 */
	static async GetNotifaction() {
		const url = `${this.baseUrl}/user/notifications`;
		return await this.get(url,{version:Vue.prototype.version});
	}
	
	/**
	 *已读单条通知
	 */
	static async Read(id) {
		const url = `${this.baseUrl}/user/read/${id}`;
		return await this.get(url,{version:Vue.prototype.version});
	}
	
	/**
	 *已读所有通知
	 */
	static async ReadAll() {
		const url = `${this.baseUrl}/user/allread`;
		return await this.get(url,{version:Vue.prototype.version});
	}
	
	/**
	 *未读通知
	 */
	static async GetUnRead() {
		const url = `${this.baseUrl}/user/unread`;
		return await this.get(url,{version:Vue.prototype.version});
	}
	
	
	/**
	 *删除单条通知
	 */
	static async DeleteSingleNotice(id) {
		const url = `${this.baseUrl}/user/delete/${id}`;
		return await this.delete(url,{version:Vue.prototype.version});
	}
	
	/**
	 *删除所有通知
	 */
	static async DeleteNotices() {
		const url = `${this.baseUrl}/user/alldelete`;
		return await this.delete(url,{version:Vue.prototype.version});
	}
	
	/**
	 *获取我加入的圈子
	 */
	static async GetMyIntendCir() {
		const url = `${this.baseUrl}/user/circles`;
		return await this.get(url,{version:Vue.prototype.version});
	}
	
	/**
	 *设置用户名
	 */
	static async SetUserName(name) {
		const url = `${this.baseUrl}/user/setname?name=${name}`;
		return await this.post(url,{version:Vue.prototype.version});
	}
	
	/**
	 *设置简介
	 */
	static async SetBio(bio) {
		const url = `${this.baseUrl}/user/setbio?bio=${bio}`;
		return await this.post(url,{version:Vue.prototype.version});
	}
	
	/**
	 *设置头像
	 */
	static async SetAvatar(avatar) {
		const url = `${this.baseUrl}/user/setavatar?avatar=${avatar}`;
		return await this.post(url,{version:Vue.prototype.version});
	}
	
	/**
	 *设置封面
	 */
	static async SetCover(cover) {
		const url = `${this.baseUrl}/user/setcover?cover=${cover}`;
		return await this.post(url,{version:Vue.prototype.version});
	}
	
	/**
	 * 签到
	 */
	static async Sign(remark) {
		const url = `${this.baseUrl}/signs/create?remark=${remark}`;
		return await this.post(url,{version:Vue.prototype.version});
	}
	
	/**
	 * 查询用户签到状态
	 */
	static async SignStatus() {
		const url = `${this.baseUrl}/signs/check`;
		return await this.get(url,{version:Vue.prototype.version});
	}
  
	/**
	 * 点赞帖子
	 */
	static async LikePost(id) {
		const url = `${this.baseUrl}/posts/${id}/like`;
		return await this.get(url);
	}
	
	/**
	 * 取消点赞帖子
	 */
	static async UnLikePost(id) {
		const url = `${this.baseUrl}/posts/${id}/unlike`;
		return await this.get(url);
	}
	
	
	/**
	 * 检查用户是否已加入圈子
	 */
	static async IsJoinCir(id) {
		const url = `${this.baseUrl}/circles/${id}/check`;
		return await this.get(url);
	}
	
	
	/**
	 * 加入圈子
	 */
	static async JoinCir(id) {
		console.log(id);
		const url = `${this.baseUrl}/circles/${id}/join`;
		return await this.get(url);
	}
	
	/**
	 * 退出圈子
	 */
	static async QuitCir(id) {
		const url = `${this.baseUrl}/circles/${id}/quit`;
		return await this.get(url);
	}
	
	/**
	 * 用户鲸币数量查询
	 */
	static async GetCheckCoin() {
		const url = `${this.baseUrl}/user/checkcoin`;
		return await this.get(url);
	}
	
	/**
	 * 使用鲸币打赏
	 */
	static async Reward(id,j_fruit,remark) {
		const url = `${this.baseUrl}/reward/reward/${id}`;
		return await this.get(url,{j_fruit:j_fruit,remark:remark});
	}
	
	/**
	 * 充值打赏
	 */
	static async InvestReward(id,j_fruit,remark) {
		const url = `${this.baseUrl}/reward/createreward/${id}`;
		return await this.get(url,{j_fruit:j_fruit,remark:remark});
	}
	
	/**
	 * 充值
	 */
	static async Invest(total) {
		const url = `${this.baseUrl}/reward/topup`;
		return await this.get(url,{total:total});
	}
	
	/**
	 * 鲸币提现
	 */
	static async withdraw(j_coin) {
		const url = `${this.baseUrl}/reward/withDraw`;
		return await this.get(url,{j_coin:j_coin});
	}
	
	/**
	 * 检查订单支付情况
	 */
	static async checkPayList(id) {
		const url = `${this.baseUrl}/reward/check/${id}`;
		return await this.get(url);
	}
	
	/**
	 * 打赏列表（头像）
	 */
	static async GetRewardIcon(id) {
		const url = `${this.baseUrl}/reward/list/${id}`;
		return await this.get(url);
	}
	
	/**
	 * 交易账单记录
	 */
	static async GetTradeList(page,limit) {
		const url = `${this.baseUrl}/reward/bill`;
		return await this.get(url,{page:page,limit:limit});
	}
	
	/**
	 * 被打赏账单
	 */
	static async GetBeRewardList(page,limit) {
		const url = `${this.baseUrl}/reward/beRewardBill`;
		return await this.get(url,{page:page,limit:limit});
	}
	
	/**
	 * 打赏账单
	 */
	static async GetRewardBillList(page,limit) {
		const url = `${this.baseUrl}/reward/rewardBill`;
		return await this.get(url,{page:page,limit:limit});
	}
	
	/**
	 * 充值账单
	 */
	static async GetInvestList(page,limit) {
		const url = `${this.baseUrl}/reward/topUpBill`;
		return await this.get(url,{page:page,limit:limit});
	}
	
	/**
	 * 提现账单
	 */
	static async GetWithdrawList(page,limit) {
		const url = `${this.baseUrl}/reward/withDrawBill`;
		return await this.get(url,{page:page,limit:limit});
	}
	
	/**
	 * 收益账单
	 */
	static async GetIncomeList(page,limit) {
		const url = `${this.baseUrl}/reward/income`;
		return await this.get(url,{page:page,limit:limit});
	}
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	//* 旧项目参考 */
	
	
	/**
	 * 获得二级好友
	 * @param {Number} page
	 */
	static async GetTeamTwo(page) {
	  return await this.get(`${this.baseUrl}/teamtwo`, {page:page, version:Vue.prototype.version})
	}
	

	/**
	 * 获得一级好友
	 * @param {Number} page
	 */
	static async GetTeamOne(page) {
	  return await this.get(`${this.baseUrl}/teamone`, {page:page, version:Vue.prototype.version})
	}
	
	/**
	 * 获得所有好友
	 * @param {Number} page
	 */
	static async GetAllTeam(page) {
	  return await this.get(`${this.baseUrl}/allteam`, {page:page, version:Vue.prototype.version})
	}
	
	/**
	 * 获取作者作品被下载奖励
	 * @param {Number} page
	 */
	static async GetAuthorDown(page) {
	  return await this.get(`${this.baseUrl}/authordown`, {page:page, version:Vue.prototype.version})
	}
	
	/**
	 * 获取用户下载奖励
	 * @param {Number} page
	 */
	static async GetUserDown(page) {
	  return await this.get(`${this.baseUrl}/userdown`, {page:page, version:Vue.prototype.version})
	}
	
	/**
	 * 获取一级好友下载分成
	 * @param {Number} page
	 */
	static async GetFromDown(page) {
	  return await this.get(`${this.baseUrl}/fromdown`, {page:page, version:Vue.prototype.version})
	}
	
	/**
	 * 获取二级好友下载分成
	 * @param {Number} page
	 */
	static async GetAncestorDown(page) {
	  return await this.get(`${this.baseUrl}/ancestordown`, {page:page, version:Vue.prototype.version})
	}
	
	/**
	 * 获取所有下载分成奖励
	 * @param {Number} page
	 */
	static async GetAllDown(page) {
	  return await this.get(`${this.baseUrl}/alldown`, {page:page, version:Vue.prototype.version})
	}
	
	/**
	 * 获取提现订单
	 * @param {Number} page
	 */
	static async GetOrder(page) {
	  return await this.get(`${this.baseUrl}/orders`, {page:page, version:Vue.prototype.version})
	}
	
	/**
	 * 获取视频数据
	 */
	static async GetVideo(url) {
		return await this.get(`${this.baseUrl}/video`,{url:url,version:Vue.prototype.version});
	}
	
	/**
	 * 获取二维码
	 */
	static GetPostQrcode(postid,uid) {
		return `${this.baseUrl}/qrcode?postid=${postid}&uid=${uid}`;
	}
	
	
	
	/**
	 * 获取微海报
	 */
	static GetPostPoster(id,uid) {
		return `${this.baseUrl}/poster/${uid}/${id}`;
	}
	/**
	 * 获取所有分类
	 */
	static async GetCategories() {
		const url = `${this.baseUrl}/categories`;
		return await this.get(url,{version:Vue.prototype.version});
	}
	
	/**
	 * 获取post
	 */
	static async GetPostData(id) {
		const url = `${this.baseUrl}/posts/${id}/data`;
		return await this.get(url);
	}
	
	/**
	 * 修改数据
	 */
	static async UpdatePostData(data) {
		const url = `${this.baseUrl}/updateposts`;
		return await this.post(url,data);
	}
	
	/**
	 * 删除数据
	 */
	static async DeletePost(id) {
		const url = `${this.baseUrl}/posts/${id}/delete`;
		return await this.delete(url);
	}
	
	/**
	 * 获取最近更新内容
	 */
	static async GetPosts(cateid, page, keyword, orderby, limit) {
		const url = `${this.baseUrl}/posts`;
		return await this.get(url, {cateid:cateid, page:page,q:keyword, orderby:orderby, limit:limit,version:Vue.prototype.version});
	}
	
	/**
	 * 获取最近更新内容
	 */
	static async GetUserPosts(page, limit) {
		const url = `${this.baseUrl}/posts`;
		// const url = 'http://bbsxqdk.test/api/posts';
		// console.log(url);
		return await this.get(url, {page:page, limit:limit,version:Vue.prototype.version});
	}
	/**
	 * 获取cash
	 */
	static async GetCashs() {
		return await this.get(`${this.baseUrl}/cashs`,{version:Vue.prototype.version});
	}
	
	/**
	 * 进行提现
	 */
	static async GoCash(cashid) {
		return await this.get(`${this.baseUrl}/gocash/${cashid}`, {version:Vue.prototype.version});
	}
	/**
	 * 获取post
	 */
	static async GetPostInfo(id) {
		const url = `${this.baseUrl}/posts/${id}`;
		return await this.get(url);
	}
	
	
	/**
	 * 删除数据
	 */
	static async DeletePost(id) {
		const url = `${this.baseUrl}/posts/${id}/delete`;
		return await this.delete(url);
	}
	/**
	 * 获取密令
	 */
	static async DownPost(id) {
		const url = `${this.baseUrl}/posts/${id}/down`;
		return await this.get(url);
	}
	
	/**
	 * 免费获取密令
	 */
	static async FreeDownPost(id) {
		const url = `${this.baseUrl}/posts/${id}/freedown`;
		return await this.get(url);
	}
	
	// 获得
	static async GetComments(id, page, orderby, limit) {
	  return await this.get(`${this.baseUrl}/posts/${id}/comments`, {page:page, orderby:orderby, limit:limit,version:Vue.prototype.version})
	}
		
	// 发布评论
	static async Comment(id, text, replyID) {
	  return await this.post(`${this.baseUrl}/posts/${id}/comments`, {reply_id: replyID, body: text})
	}
		
		
	/**
	 * 关小黑屋
	 */
	static async LockUser(userid) {
		const url = `${this.baseUrl}/lockuser`;
		return await this.get(url,{userid:userid});
	}
	
	/**
	 * 举报评论
	 */
	static async ReplyComment(data) {
		const url = `${this.baseUrl}/reply/comment`;
		return await this.post(url,data);
	}
	/**
	 * 举报
	 */
	static async ReplyPost(data) {
		const url = `${this.baseUrl}/reply/post`;
		return await this.post(url,data);
	}
	/**
	 * 举报用户
	 */
	static async ReplyUser(data) {
		const url = `${this.baseUrl}/reply/user`;
		return await this.post(url,data);
	}
	/**
	 * 点赞帖子
	 */
	/* static async LikePost(postid) {
		const url = `${this.baseUrl}/posts/${postid}/like`;
		return await this.get(url);
	} */
	
	/**
	 * 取消点赞帖子
	 */
	/* static async UnLikePost(postid) {
		const url = `${this.baseUrl}/posts/${postid}/unlike`;
		return await this.get(url);
	} */
	
	
	
	/**
	 * 添加数据
	 */
	static async PostPostData(data) {
		const url = `${this.baseUrl}/posts`;
		return await this.post(url,data);
	}
	
	
	/**
	 * 举报
	 */
	static async PostReportData(data) {
		const url = `${this.baseUrl}/reports`;
		return await this.post(url,data);
	}
	

	

}
